/***************************************************************************
 *   Copyright (C) 2007 by Andrzej Oczkowicz   *
 *   andrew_lz@poczta.fm   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/


#ifndef KMEDIACATALOG_H
#define KMEDIACATALOG_H

#include <QMainWindow>
#include <QLabel>
#include <QCloseEvent>

#include ".ui/ui_dmain.h"
#include "kmodule.h"


class kGuiUtils;


class kMediaCatalog : public QMainWindow, public Ui::MainWindow
{
      Q_OBJECT
public: 
      kMediaCatalog();
      ~kMediaCatalog();
      void createActions();
      void createMenus();
      void createToolBars();
      void createStatusBar();
      void createAction(QAction*&action, char*slot, const QString & icon, const QString & name, const QString & shortcut = QString::null, const QString & tip = QString::null);


public:
      void startTree();
      void addNode(kNode*node);
      bool openCatalog(kOutputBasic*out, const QString&name);
      void buildTree(kOutputBasic * out);
      void addSubNodes(kOutputBasic * out, QTreeWidgetItem*root, kNode*node);

protected:
      void closeEvent(QCloseEvent *event);

private slots:
      void fileNew();
      void fileOpen();
      bool fileSave();
      bool fileSaveAs();

      void appAbout();
      void appAboutQt();
      void appExit();

private:
      QMenu *fileMenu;
      QMenu *editMenu;
      QMenu *helpMenu;

      QToolBar *fileToolBar;
      QToolBar *editToolBar;

      QAction * fileNewAct;
      QAction * fileOpenAct;
      QAction * fileSaveAct;
      QAction * fileSaveAsAct;
      QAction * appAboutQtAct;
      QAction * appAboutAct;
      QAction * appExitAct;

};


#endif
